package db

import (
	"github.com/jinzhu/gorm"
	"qweewq.tk/flyff/pgk/common/game"
)

/**
TbMail 邮件
*/
type TbMail struct {
	gorm.Model

	//ReceiverID 接收者编号，对应角色编号
	ReceiverID uint64 `gorm:"not null"`
	//SenderID 发送者编号，对应角色编号
	SenderID uint64 `gorm:"not null"`
	//Title 邮件标题
	Title string `gorm:"type:varchar(128);not null"`
	//ReadFlag 是否已读，默认为false未读取
	ReadFlag bool
	//Detail 邮件详细信息
	Detail TbMailDetail

	//TbActorID 角色ID
	TbActorID uint
}

/**
TbMailDetail 邮件详细信息
*/
type TbMailDetail struct {
	//common.Gold 邮件所发金币
	game.Gold
	//common.Exp 邮件所发经验
	game.Exp
	//Text 邮件详细内容
	Text string `gorm:"type:varchar(256)"`
	//Items 邮件所发物品
	Items []TbItem
	//TbMailID 邮件ID
	TbMailID uint `gorm:"primary_key"`
}
